//funciones de superaccion.
function hacer(what){ $.get("/do/"+what); get_current_song(); }
function play(id){ $.get("/listen/"+id); get_current_song(); }
function get_current_song(){
    $('#curr').html('<img src="extras/images/Transfer.png"/>');
    $.get("/current",function(song){
	    $('#curr').ajaxSuccess(function(evt, request, settings){
		    $(this).html(song);
		});
	});
}
function buscar(){
    var typ = $('search_type').value;
    var wha = $('search_what').value;
    $.get("/search/"+typ+"|"+wha,function(list){
	    $('#canciones').ajaxSuccess(function(evt,request,settings){
		    $(this).html(list);
		});
	});
}
function add(file){
    $.get("/addtoplaylist/"+file);
    $('#listapls').html('<img src="extras/images/Transfer.png"/>');
    $.get("/listpls",function(pls){
	    $('#listapls').ajaxSuccess(function(evt,request,settings){
		    $(this).html(pls);
		});
	});
}
function remove(file){
    $.get("/removetoplaylist/"+file);
    $.get("/listpls",function(pls){
	    $('#listapls').ajaxSuccess(function(evt,request,settings){
		    $(this).html(pls);
		});
	});
	    }
function read_dir(dir){
    $.get("/getdir/"+dir,function(pls){
	    $('#listadb').ajaxSuccess(function(evt,request,settings){
		    $(this).html(pls);
		});
	});
}

//function build_dirlist(){  
//}

//onload
$(document).ready(function(){
	get_current_song();
	//	build_dirlist();
    });

